import Vue from 'vue'
import {
  Card,
  Button,
  Table,
  TableColumn,
  Input,
  Form,
  FormItem,
  Container,
  Main,
  Aside,
  Header,
  Menu,
  MenuItem,
  MenuItemGroup,
  Submenu,
  Breadcrumb,
  BreadcrumbItem,
  Dropdown,
  DropdownItem,
  DropdownMenu,
  Message,
  Divider,
  Tag,
  RadioGroup,
  Radio,
  Select,
  Option,
  MessageBox,
  Tree,
  Pagination,
  Upload,
  Dialog,
  Switch,
  Tabs,
  TabPane
} from 'element-ui'
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Switch)
Vue.use(Upload)
Vue.use(Dialog)
Vue.use(Tree)
Vue.use(Pagination)
Vue.use(Option)
Vue.use(Select)
Vue.use(RadioGroup)
Vue.use(Radio)
Vue.use(Tag)
Vue.use(Divider)
Vue.use(Dropdown)
Vue.use(DropdownItem)
Vue.use(DropdownMenu)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Card)
Vue.use(Button)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Input)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Container)
Vue.use(Aside)
Vue.use(Header)
Vue.use(Main)
Vue.use(Menu)
Vue.use(MenuItem)
Vue.use(MenuItemGroup)
Vue.use(Submenu)

// 成功提示
Vue.prototype.$success = function (message) {
  Message({
    type: 'success',
    message
  })
}
// 错误提示
Vue.prototype.$error = function (message) {
  Message({
    type: 'error',
    message
  })
}

// 确认提示框
// Vue.prototype.$confirm=MessageBox.confirm
Vue.prototype.$confirm = function (callback) {
  MessageBox.confirm('是否确定?', '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning'
  }).then(() => {
    callback && callback()
  }).catch(() => {

  })
}
